#pragma once

#include "stdafx.h"
#include "util/named.h"
#include "core/event.h"

namespace natrium {
	namespace video {
		class Video;

		class Window:
			public util::Named
		{
		public:
			virtual ~Window();

			enum eScreenAspect {
				ASPECT_4_3 = 1,
				ASPECT_16_9 = 2,
				ASPECT_16_10 = 3,
				UNKNOWN_ASPECT
			};

			eScreenAspect getScreenAspect() const;
			float getScreenAspectRatio() const;

			eScreenAspect getWindowAspect() const;
			float getWindowAspectRatio() const;

			static int glfwCloseCallback();

			unsigned int getWidth() const;
			unsigned int getHeight() const;

		private:
			friend class Video;

			Window(const std::string& name);

			void create();
			void destroy();

			//battery of configurable settings
			unsigned int mHeight;
			unsigned int mWidth;

			bool mFullscreen;
			bool mAutoSizeWindow; //when set to true, the window will automagically be the desktop resolution

			std::string mTitle;

			bool mIsInitialized;

			/** detected stuff **/
			GLFWvidmode mDesktopMode;
			float mScreenAspectRatio;
			float mWindowAspectRatio;
			eScreenAspect mScreenAspectType;
			eScreenAspect mWindowAspectType;
		};
	}
}